#ifndef CLUSTER_HPP
#define CLUSTER_HPP

#include "clusternode.hpp"
#include "slice.hpp"
#include "sliceiterator.hpp"
#include "sliceutils.hpp"

class ClusterNode;

class Cluster {
  public:
    Cluster();
    Cluster(const Slice &slice);
    Cluster(ClusterNode *node);
    void setNode(ClusterNode *node);
    ClusterNode * getNode() const;
    void scoop(Slice &volumeSlice);
    const Vector3d & getCentreOfGravity() const;
    double getSize() const;
    void setSize(double size);
    const Vector3i & getOffset() const;
    void setOffset(const Vector3i &offset);
    const Slice & slice() const;
  private:
    void calculateScoopDistance();
    void calculateCentreOfGravity();

    //fields
    ClusterNode *node;
    double scoopDistance;
    Vector3d cog;
    double size;
    Vector3i offset;
    Slice clusterSlice;
};

#endif
